package com.yuyou.fn.educational.mapper;

import com.github.wens.mybatisplus.mapper.AutoMapper;
import com.yuyou.fn.educational.entity.ClassLecture;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

/**
 *
 * ClassLecture 表数据库控制层接口
 *
 */
public interface ClassLectureMapper extends AutoMapper<ClassLecture,Long> {


    @Update("update class_lecture set teacher_id  = null , teacher_name = null ,update_time= now() where class_id = #{classId}")
    void clearTeacher(@Param("classId") Long classId);

    @Update("update class_lecture set class_date  = null , start_time = null,end_time = null,update_time= now()  where class_id = #{classId}")
    void clearClassTime(Long classId);

    List<ClassLecture> findClassLectruesBetweenDate(@Param("startDate") Date startDate,
                                                    @Param("endDate") Date endDate,
                                                    @Param("attendanceStatus") Integer attendanceStatus);
}